package cn.dac.controller;

import cn.dac.entity.User;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
@RequestMapping("fastjson")
//支持跨域
@CrossOrigin(origins="http://localhost:8089")
public class FastjsonController {


    @RequestMapping("/test")
    public User test() {
        User user = new User();

        user.setId(1);
        user.setUsername("Anan");
        user.setPassword("123456");
        user.setBirthday(new Date());

        return user;
    }


}
